{# keep this file sync'ed with 'squad/frontend/templates/django/squad/_user_menu.html' #}

{% if user.is_authenticated %}
  <li>
      <a class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
        <img src="{{avatar_url(user.email, 20)}}" class='avatar-sm'/>
        <span class="caret"></span>
      </a>
      <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
        <li>
          <div>
            {{ (_('Signed in as %(username)s') % {'username': '<strong>' + user.username + '</strong>'}) | safe }}
          </div>
        </li>
        {% if user.is_staff %}
          <li role="separator" class="divider"></li>
          <li><a href="/admin/">{{ _('Administration') }}</a></li>
          {% if url('health_check') %}
              <li><a href="/ht/">{{ _('System status') }}</a></li>
          {% endif %}
        {% endif %}
        <li role="separator" class="divider"></li>
        <li><a href="{{url('settings-home')}}">{{ _('Settings')}}</a></li>
        <li><a href="/logout">{{ _('Sign out') }}</a></li>
      </ul>
  </li>
{% else %}
  <li>
    <a href="/login/?next={{request.path}}"><i class='fa fa-sign-in'></i> {{ _('Log in') }}</a>
  </li>
{% endif %}
